<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCompaniesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('companies', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name')->nullable(false)->default('')->comment('公司名');
            $table->integer('roaster')->nullable(false)->default(0);
            $table->tinyInteger('subscription')->default(0)->nullable(false)->comment('是否支持订阅');
            $table->string('website')->nullable(false)->default('')->comment('网址');
            $table->string('logo')->default('')->nullable(false)->comment('logo');
            $table->string('description')->default('')->nullable(false)->comment('描述');
            $table->integer('added_by')->default(0)->nullable(false)->unsigned()->comment('添加者');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('companies');
    }
}
